<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script>
      function showBtnValue() {
        console.log('我被点击了...')
        var btnComp = document.getElementById('btn')
        console.log('按钮元素:'+btnComp)
        console.log('按钮元素:'+btnComp.value)
        console.log('按钮元素:'+btnComp.id)
        console.log('按钮元素:'+btnComp.type)
      }
    </script>
  </head>
  <body>
    <input type="button" value="测试按钮" id="btn" onclick="showBtnValue()" />
  </body>
</html>
